import baseConfig from './vite.config.base'
import { ConfigEnv, UserConfig } from 'vite'

export default ({ command, mode }: ConfigEnv): UserConfig => ({
  ...baseConfig({ command, mode }),
  ...{
    mode: 'dev',
    server: {
      open: true,
      fs: {
        strict: true,
      },
      host: '0.0.0.0',
      port: 14080,
      https: false,
      // proxy: {
      //   '/api': {
      //     // target: 'http://19u82v8250.iok.la/', //实际请求地址
      //     target: 'http://collect.zhenghaoduo.com/api/', //实际请求地址
      //     changeOrigin: true,
      //     rewrite: (path) => path.replace(/^\/api/, ''),
      //   },
      // },
    },
  },
})
